package com.ssm.service.impl;

import com.ssm.mapper.TaskMapper;
import com.ssm.pojo.Build;
import com.ssm.pojo.Task;
import com.ssm.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TaskServiceImpl implements TaskService {
    @Autowired
    private TaskMapper taskMapper;
    //查询所有未接收的任务状态
    @Override
    public List<Task> selectTasks() {
        return taskMapper.selectTasks();
    }

    @Override
    public int addTask(Integer stuId, String taskName, String reward, String taskcontext) {
        return taskMapper.addTask(stuId,taskName,reward,taskcontext);
    }

    @Override
    public List<Task> selectTaskByTaskId(Integer taskId) {
        return taskMapper.selectTaskByTaskId(taskId);
    }

    @Override
    public Integer updateState(Integer state,Integer acceptStuId,Integer taskId) {
        return taskMapper.updateState(state,acceptStuId,taskId);
    }

    @Override
    public List<Task> selectThree() {
        return taskMapper.selectThree();
    }

    @Override
    public List<Task> selectThree1() {
        return taskMapper.selectThree1();
    }

    @Override
    public List<Task> selectSelf(Integer stuId) {
        return taskMapper.selectSelf(stuId);
    }

    @Override
    public Integer deleteTask(Integer taskId) {
        return taskMapper.deleteTask(taskId);
    }

    @Override
    public Integer updateReceiveState(Integer taskId) {
        return taskMapper.updateReceiveState(taskId);
    }

    @Override
    public List<Task> selectTaskByState(Integer stuId) {
        return taskMapper.selectTaskByState(stuId);
    }

    @Override
    public List<Task> selectFinishTask(Integer stuId) {
        return taskMapper.selectFinishTask(stuId);
    }

    @Override
    public List<Task> selTasks() {
        return taskMapper.selTasks();
    }

    @Override
    public int delTaskById(int taskId) {
        return taskMapper.delTaskById(taskId);
    }

    @Override
    public int delTasks(int[] ids) {
        return taskMapper.delTasks(ids);
    }

    @Override
    public List<Task> selTask(Integer state) {
        return taskMapper.selTask(state);
    }

    @Override
    public List<Task> selTaskss() {
        return taskMapper.selectTaskss();
    }

    @Override
    public List<Task> selectByKey(String key) {
        return taskMapper.selectByKey(key);
    }
}
